This is our convention.
The only exceptions are double quotes for words in comments that give
them a special meaning (though beware that these quotes are not truly
necessary most of the time) and double quotes that need to be a part
of the output string.
show : function(backward) {
let tracker = Shell.WindowTracker.get_default();
- let apps = tracker.get_running_apps ("");
+ let apps = tracker.get_running_apps ('');
if (!apps.length)
return false;
Tweener.addTween(this._thumbnails.actor,
{ opacity: 0,
time: THUMBNAIL_FADE_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: function() { this.destroy(); }
});
this._thumbnails = null;
Tweener.addTween(this._thumbnails.actor,
{ opacity: 255,
time: THUMBNAIL_FADE_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
}
};
AppIcon.prototype = {
_init: function(app) {
this.app = app;
- this.actor = new St.BoxLayout({ style_class: "alt-tab-app",
+ this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
vertical: true });
this.icon = null;
this._iconBin = new St.Bin();
let activeWorkspace = global.screen.get_active_workspace();
- // We fake the value of "separatorAdded" when the app has no window
+ // We fake the value of 'separatorAdded' when the app has no window
// on the current workspace, to avoid displaying a useless separator in
// that case.
let separatorAdded = windows.length == 0 || windows[0].get_workspace() != activeWorkspace;
separatorAdded = true;
}
- let box = new St.BoxLayout({ style_class: "thumbnail-box",
+ let box = new St.BoxLayout({ style_class: 'thumbnail-box',
vertical: true });
- let bin = new St.Bin({ style_class: "thumbnail" });
+ let bin = new St.Bin({ style_class: 'thumbnail' });
box.add_actor(bin);
this._thumbnailBins.push(bin);
},
expandSearch: function(terms) {
- log("TODO expand search");
+ log('TODO expand search');
}
};
},
_appendSeparator: function () {
- let bin = new St.Bin({ style_class: "app-well-menu-separator" });
+ let bin = new St.Bin({ style_class: 'app-well-menu-separator' });
this._windowContainer.add_actor(bin);
},
WellGrid.prototype = {
_init: function() {
- this.actor = new St.BoxLayout({ name: "dashAppWell", vertical: true });
+ this.actor = new St.BoxLayout({ name: 'dashAppWell', vertical: true });
// Pulled from CSS, but hardcode some defaults here
this._spacing = 0;
this._item_size = 48;
let favorites = AppFavorites.getAppFavorites().getFavoriteMap();
/* hardcode here pending some design about how exactly desktop contexts behave */
- let contextId = "";
+ let contextId = '';
let running = this._tracker.get_running_apps(contextId);
let runningIds = this._appIdListToHash(running);
BoxPointer.prototype = {
_init: function(arrowSide, sourceActor, binProperties) {
if (arrowSide != St.Side.TOP)
- throw new Error("not implemented");
+ throw new Error('Not implemented');
this._arrowSide = arrowSide;
this._sourceActor = sourceActor;
this._arrowOrigin = 0;
// GTK+ by preference uses nl_langinfo (NL_TIME_FIRST_WEEKDAY). We probably
// should add a C function so we can do the full handling.
this._weekStart = NaN;
- let weekStartString = Gettext_gtk20.gettext("calendar:week_start:0");
- if (weekStartString.indexOf("calendar:week_start:") == 0) {
+ let weekStartString = Gettext_gtk20.gettext('calendar:week_start:0');
+ if (weekStartString.indexOf('calendar:week_start:') == 0) {
this._weekStart = parseInt(weekStartString.substring(20));
}
if (isNaN(this._weekStart) || this._weekStart < 0 || this._weekStart > 6) {
- log("Translation of 'calendar:week_start:0' in GTK+ is not correct");
+ log('Translation of "calendar:week_start:0" in GTK+ is not correct');
this._weekStart = 0;
}
// Find the ordering for month/year in the calendar heading
- switch (Gettext_gtk20.gettext("calendar:MY")) {
- case "calendar:MY":
- this._headerFormat = "%B %Y";
+ switch (Gettext_gtk20.gettext('calendar:MY')) {
+ case 'calendar:MY':
+ this._headerFormat = '%B %Y';
break;
- case "calendar:YM":
- this._headerFormat = "%Y %B";
+ case 'calendar:YM':
+ this._headerFormat = '%Y %B';
break;
default:
- log("Translation of 'calendar:MY' in GTK+ is not correct");
- this._headerFormat = "%B %Y";
+ log('Translation of "calendar:MY" in GTK+ is not correct');
+ this._headerFormat = '%B %Y';
break;
}
this.date = new Date();
this.actor = new St.Table({ homogeneous: false,
- style_class: "calendar",
+ style_class: 'calendar',
reactive: true });
this.actor.connect('scroll-event',
this.actor.add(this._topBox,
{ row: 0, col: 0, col_span: 7 });
- let [backlabel, forwardlabel] = ["<", ">"];
+ let [backlabel, forwardlabel] = ['<', '>'];
if (St.Widget.get_default_direction () == St.TextDirection.RTL) {
[backlabel, forwardlabel] = [forwardlabel, backlabel];
}
let back = new St.Button({ label: backlabel, style_class: 'calendar-change-month' });
this._topBox.add(back);
- back.connect("clicked", Lang.bind(this, this._prevMonth));
+ back.connect('clicked', Lang.bind(this, this._prevMonth));
this._dateLabel = new St.Label();
this._topBox.add(this._dateLabel, { expand: true, x_fill: false, x_align: St.Align.MIDDLE });
let forward = new St.Button({ label: forwardlabel, style_class: 'calendar-change-month' });
this._topBox.add(forward);
- forward.connect("clicked", Lang.bind(this, this._nextMonth));
+ forward.connect('clicked', Lang.bind(this, this._nextMonth));
// We need to figure out the abbreviated localized names for the days of the week;
// we do this by just getting the next 7 days starting from right now and then putting
iter.setSeconds(0); // Leap second protection. Hah!
iter.setHours(12);
for (let i = 0; i < 7; i++) {
- this.actor.add(new St.Label({ text: iter.toLocaleFormat("%a") }),
+ this.actor.add(new St.Label({ text: iter.toLocaleFormat('%a') }),
{ row: 1,
col: (7 + iter.getDay() - this._weekStart) % 7,
x_fill: false, x_align: St.Align.END });
while (true) {
let label = new St.Label({ text: iter.getDate().toString() });
if (_sameDay(now, iter))
- label.style_class = "calendar-day calendar-today";
+ label.style_class = 'calendar-day calendar-today';
else if (iter.getMonth() != this.date.getMonth())
- label.style_class = "calendar-day calendar-other-month-day";
+ label.style_class = 'calendar-day calendar-other-month-day';
else
- label.style_class = "calendar-day";
+ label.style_class = 'calendar-day';
this.actor.add(label,
{ row: row, col: (7 + iter.getDay() - this._weekStart) % 7,
x_fill: false, x_align: St.Align.END });
// The chrome layer should be visible unless there is a window
// with layer FULLSCREEN, or a window with layer
// OVERRIDE_REDIRECT that covers the whole screen.
- // ("override_redirect" is not actually a layer above all
+ // ('override_redirect' is not actually a layer above all
// other windows, but this seems to be how mutter treats it
// currently...) If we wanted to be extra clever, we could
// figure out when an OVERRIDE_REDIRECT window was trying to
// 25 search results (per result type) should be enough for everyone
const MAX_RENDERED_SEARCH_RESULTS = 25;
-const DOCS = "docs";
-const PLACES = "places";
+const DOCS = 'docs';
+const PLACES = 'places';
/*
* Returns the index in an array of a given length that is obtained
_init: function () {
this._open = false;
- this.actor = new St.BoxLayout({ style_class: "dash-pane",
+ this.actor = new St.BoxLayout({ style_class: 'dash-pane',
vertical: true,
reactive: true });
this.actor.connect('button-press-event', Lang.bind(this, function (a, e) {
SearchEntry.prototype = {
_init : function() {
- this.actor = new St.Entry({ name: "searchEntry",
+ this.actor = new St.Entry({ name: 'searchEntry',
hint_text: _("Find") });
this.entry = this.actor.clutter_text;
function() {
if (this.isActive())
this.actor.set_secondary_icon_from_file(global.imagedir +
- "close-black.svg");
+ 'close-black.svg');
else
this.actor.set_secondary_icon_from_file(null);
}));
let meta = this._metaForProvider(provider);
meta.actor.show();
meta.resultDisplay.renderResults(providerResults, terms);
- meta.count.set_text(""+providerResults.length);
+ meta.count.set_text('' + providerResults.length);
}
this.selectDown(false);
MoreLink.prototype = {
_init : function () {
- this.actor = new St.BoxLayout({ style_class: "more-link",
+ this.actor = new St.BoxLayout({ style_class: 'more-link',
reactive: true });
this.pane = null;
- this._expander = new St.Bin({ style_class: "more-link-expander" });
+ this._expander = new St.Bin({ style_class: 'more-link-expander' });
this.actor.add(this._expander, { expand: true, y_fill: false });
},
BackLink.prototype = {
_init : function () {
- this.actor = new St.Button({ style_class: "section-header-back",
+ this.actor = new St.Button({ style_class: 'section-header-back',
reactive: true });
- this.actor.set_child(new St.Bin({ style_class: "section-header-back-image" }));
+ this.actor.set_child(new St.Bin({ style_class: 'section-header-back-image' }));
}
};
SectionHeader.prototype = {
_init : function (title, suppressBrowse) {
- this.actor = new St.Bin({ style_class: "section-header",
+ this.actor = new St.Bin({ style_class: 'section-header',
x_align: St.Align.START,
x_fill: true,
y_fill: true,
reactive: !suppressBrowse });
- this._innerBox = new St.BoxLayout({ style_class: "section-header-inner" });
+ this._innerBox = new St.BoxLayout({ style_class: 'section-header-inner' });
this.actor.set_child(this._innerBox);
this.backLink = new BackLink();
this.emit('back-link-activated');
}));
- let textBox = new St.BoxLayout({ style_class: "section-text-content" });
- this.text = new St.Label({ style_class: "section-title",
+ let textBox = new St.BoxLayout({ style_class: 'section-text-content' });
+ this.text = new St.Label({ style_class: 'section-title',
text: title });
textBox.add(this.text, { x_align: St.Align.START });
- this.countText = new St.Label({ style_class: "section-count" });
+ this.countText = new St.Label({ style_class: 'section-count' });
textBox.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END });
this.countText.hide();
},
setCountText : function(countText) {
- if (countText == "") {
+ if (countText == '') {
this.countText.hide();
} else {
this.countText.show();
SearchSectionHeader.prototype = {
_init : function(title, onClick) {
- this.actor = new St.Button({ style_class: "dash-search-section-header",
+ this.actor = new St.Button({ style_class: 'dash-search-section-header',
x_fill: true,
y_fill: true });
let box = new St.BoxLayout();
this.actor.set_child(box);
- let titleText = new St.Label({ style_class: "dash-search-section-title",
+ let titleText = new St.Label({ style_class: 'dash-search-section-title',
text: title });
- this.countText = new St.Label({ style_class: "dash-search-section-count" });
+ this.countText = new St.Label({ style_class: 'dash-search-section-count' });
box.add(titleText);
box.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END });
// of the Group actor ends up including the width of its hidden children, so we were getting a reactive object as
// wide as the details pane that was blocking the clicks to the workspaces underneath it even when the details pane
// was actually hidden.
- this.actor = new St.BoxLayout({ name: "dash",
+ this.actor = new St.BoxLayout({ name: 'dash',
vertical: true,
reactive: true });
// The searchArea just holds the entry
- this.searchArea = new St.BoxLayout({ name: "dashSearchArea",
+ this.searchArea = new St.BoxLayout({ name: 'dashSearchArea',
vertical: true });
- this.sectionArea = new St.BoxLayout({ name: "dashSections",
+ this.sectionArea = new St.BoxLayout({ name: 'dashSections',
vertical: true });
this.actor.add(this.searchArea);
{ scale_x: scale * origScale,
scale_y: scale * origScale,
time: SCALE_ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onUpdate: function() {
let currentScale = this._dragActor.scale_x / origScale;
this._dragOffsetX = currentScale * origDragOffsetX;
scale_y: this._snapBackScale,
opacity: this._dragOrigOpacity,
time: SNAP_BACK_ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._onSnapBackComplete,
onCompleteScope: this,
onCompleteParams: [this._dragActor, eventTime]
GenericDisplay.GenericDisplayItem.prototype._init.call(this);
this._docInfo = docInfo;
- this._setItemInfo(docInfo.name, "");
+ this._setItemInfo(docInfo.name, '');
this._timeoutTime = -1;
this._resetTimeDisplay(currentSecs);
// Creates and returns a large preview icon, but only if this._docInfo is an image file
// and we were able to generate a pixbuf from it successfully.
_createLargePreviewIcon : function() {
- if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf("image/") != 0)
+ if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf('image/') != 0)
return null;
try {
},
expandSearch: function(terms) {
- log("TODO expand docs search");
+ log('TODO expand docs search');
}
};
String.prototype.format = Format.format;
// Set the default direction for St widgets (this needs to be done before any use of St)
- if (Gettext_gtk20.gettext("default:LTR") == "default:RTL") {
+ if (Gettext_gtk20.gettext('default:LTR') == 'default:RTL') {
St.Widget.set_default_direction(St.TextDirection.RTL);
}
}
try {
userExtensionsDir.make_directory_with_parents(null);
} catch (e) {
- global.logError(""+e);
+ global.logError('' + e);
}
disabledExtensions = Shell.GConf.get_default().get_string_list('disabled_extensions');
GenericDisplayItem.prototype = {
_init: function() {
- this.actor = new St.BoxLayout({ style_class: "generic-display-item",
+ this.actor = new St.BoxLayout({ style_class: 'generic-display-item',
reactive: true });
this.actor._delegate = this;
// Performes an action associated with launching this item, such as opening a file or an application.
launch: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
//// Protected methods ////
this._icon = this._createIcon();
this._iconBin.set_child(this._icon);
- this._name = new St.Label({ style_class: "generic-display-item-name",
+ this._name = new St.Label({ style_class: 'generic-display-item-name',
text: nameText });
this._infoText.add(this._name);
- this._description = new St.Label({ style_class: "generic-display-item-description",
- text: descriptionText ? descriptionText : "" });
+ this._description = new St.Label({ style_class: 'generic-display-item-description',
+ text: descriptionText ? descriptionText : '' });
this._infoText.add(this._description);
},
// Returns an icon for the item.
_createIcon: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
// Returns a preview icon for the item.
_createPreviewIcon: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
}
//// Private methods ////
// TODO: figure out why this._list.displayedCount is returning a
// positive number when this._mathedItems.length is 0
// This can be triggered if a search string is entered for which there are no matches.
- // log("this._mathedItems.length: " + this._matchedItems.length + " this._list.displayedCount " + this._list.displayedCount);
+ // log('this._mathedItems.length: ' + this._matchedItems.length + ' this._list.displayedCount ' + this._list.displayedCount);
return this._matchedItemKeys.length > 0;
},
// and adds it to the list of displayed items, but does not yet display it.
_addDisplayItem : function(itemId) {
if (this._displayedItems.hasOwnProperty(itemId)) {
- log("Tried adding a display item for " + itemId + ", but an item with this item id is already among displayed items.");
+ log('Tried adding a display item for ' + itemId + ', but an item with this item id is already among displayed items.');
return;
}
// Return true if there's an active search or other constraint
// on the list
_filterActive: function() {
- return this._search != "";
+ return this._search != '';
},
// Called when we are resetting state
// Implementation should return %true if we are up to date, and %false
// if a full reload occurred.
_refreshCache: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
// Sets the list of the displayed items based on the default sorting order.
// The default sorting order is specific to each implementing class.
_setDefaultList: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
// Compares items associated with the item ids based on the order in which the
// Intended to be used as a compareFunction for array.sort().
// Returns an integer value indicating the result of the comparison.
_compareItems: function(itemIdA, itemIdB) {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
// Checks if the item info can be a match for the search string.
// Returns a boolean flag indicating if that's the case.
_isInfoMatching: function(itemInfo, search) {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
// Creates a display item based on itemInfo.
_createDisplayItem: function(itemInfo) {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
//// Private methods ////
const Main = imports.ui.main;
/* Imports...feel free to add here as needed */
-var commandHeader = "const Clutter = imports.gi.Clutter; " +
- "const GLib = imports.gi.GLib; " +
- "const Gtk = imports.gi.Gtk; " +
- "const Mainloop = imports.mainloop; " +
- "const Meta = imports.gi.Meta; " +
- "const Shell = imports.gi.Shell; " +
- "const Main = imports.ui.main; " +
- "const Lang = imports.lang; " +
- "const Tweener = imports.ui.tweener; " +
+var commandHeader = 'const Clutter = imports.gi.Clutter; ' +
+ 'const GLib = imports.gi.GLib; ' +
+ 'const Gtk = imports.gi.Gtk; ' +
+ 'const Mainloop = imports.mainloop; ' +
+ 'const Meta = imports.gi.Meta; ' +
+ 'const Shell = imports.gi.Shell; ' +
+ 'const Main = imports.ui.main; ' +
+ 'const Lang = imports.lang; ' +
+ 'const Tweener = imports.ui.tweener; ' +
/* Utility functions...we should probably be able to use these
* in the shell core code too. */
- "const stage = global.stage; " +
- "const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; " +
+ 'const stage = global.stage; ' +
+ 'const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; ' +
/* Special lookingGlass functions */
- "const it = Main.lookingGlass.getIt(); " +
- "const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); ";
+ 'const it = Main.lookingGlass.getIt(); ' +
+ 'const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); ';
function Notebook() {
this._init();
_init: function() {
this.actor = new St.BoxLayout({ vertical: true });
- this.tabControls = new St.BoxLayout({ style_class: "labels" });
+ this.tabControls = new St.BoxLayout({ style_class: 'labels' });
this._selectedIndex = -1;
this._tabs = [];
},
appendPage: function(name, child) {
- let labelBox = new St.BoxLayout({ style_class: "notebook-tab" });
+ let labelBox = new St.BoxLayout({ style_class: 'notebook-tab' });
let label = new St.Button({ label: name });
label.connect('clicked', Lang.bind(this, function () {
this.selectChild(child);
cmdTxt.ellipsize = Pango.EllipsizeMode.END;
this.actor.add(cmdTxt);
- let resultTxt = new St.Label({ text: "r(" + index + ") = " + o });
+ let resultTxt = new St.Label({ text: 'r(' + index + ') = ' + o });
resultTxt.ellipsize = Pango.EllipsizeMode.END;
this.actor.add(resultTxt);
- let line = new Clutter.Rectangle({ name: "Separator",
+ let line = new Clutter.Rectangle({ name: 'Separator',
height: 1 });
- let padBin = new St.Bin({ name: "Separator", x_fill: true, y_fill: true });
+ let padBin = new St.Bin({ name: 'Separator', x_fill: true, y_fill: true });
padBin.add_actor(line);
this.actor.add(padBin);
}
WindowList.prototype = {
_init : function () {
- this.actor = new St.BoxLayout({ name: "Windows", vertical: true, style: "spacing: 8px" });
+ this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
let display = global.screen.get_display();
let tracker = Shell.WindowTracker.get_default();
this._updateId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._updateWindowList));
box.add(label.actor);
let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' });
box.add(propsBox);
- propsBox.add(new St.Label({ text: "wmclass: " + metaWindow.get_wm_class() }));
+ propsBox.add(new St.Label({ text: 'wmclass: ' + metaWindow.get_wm_class() }));
let app = tracker.get_window_app(metaWindow);
if (app != null && !app.is_transient()) {
let icon = app.create_icon_texture(22);
let propBox = new St.BoxLayout({ style: 'spacing: 6px; ' });
propsBox.add(propBox);
- propBox.add(new St.Label({ text: "app: " + app.get_id() }), { y_align: St.Align.MIDDLE });
+ propBox.add(new St.Label({ text: 'app: ' + app.get_id() }), { y_align: St.Align.MIDDLE });
propBox.add(icon, { y_align: St.Align.MIDDLE });
} else {
- propsBox.add(new St.Label({ text: "<untracked>" }));
+ propsBox.add(new St.Label({ text: '<untracked>' }));
}
}
}
this._parentList = [];
- this.actor = new St.BoxLayout({ name: "PropertyInspector", vertical: true });
+ this.actor = new St.BoxLayout({ name: 'PropertyInspector', vertical: true });
},
setTarget: function(actor) {
for (let propName in actor) {
let valueStr;
try {
- valueStr = "" + actor[propName];
+ valueStr = '' + actor[propName];
} catch (e) {
valueStr = '<error>';
}
- let propText = propName + ": " + valueStr;
+ let propText = propName + ': ' + valueStr;
let propDisplay = new St.Label({ reactive: true,
text: propText });
this.actor.add_actor(propDisplay);
_init: function() {
let width = 150;
let primary = global.get_primary_monitor();
- let eventHandler = new St.BoxLayout({ name: "LookingGlassDialog",
+ let eventHandler = new St.BoxLayout({ name: 'LookingGlassDialog',
vertical: false,
y: primary.y + Math.floor(primary.height / 2),
reactive: true });
let stack = Main._getAndClearErrorStack();
for (let i = 0; i < stack.length; i++) {
let logItem = stack[i];
- text += logItem.category + " t=" + this._formatTime(new Date(logItem.timestamp)) + " " + logItem.message + "\n";
+ text += logItem.category + ' t=' + this._formatTime(new Date(logItem.timestamp)) + ' ' + logItem.message + '\n';
}
this.text.text = text;
}
case ExtensionSystem.ExtensionState.OUT_OF_DATE:
return _("Out of date");
}
- return "Unknown"; // Not translated, shouldn't appear
+ return 'Unknown'; // Not translated, shouldn't appear
},
_createExtensionDisplay: function(meta) {
LookingGlass.prototype = {
_init : function() {
this._idleHistorySaveId = 0;
- let historyPath = global.userdatadir + "/lookingglass-history.txt";
+ let historyPath = global.userdatadir + '/lookingglass-history.txt';
this._historyFile = Gio.file_new_for_path(historyPath);
this._savedText = null;
this._historyNavIndex = -1;
// Sort of magic, but...eh.
this._maxItems = 150;
- this.actor = new St.BoxLayout({ name: "LookingGlassDialog",
+ this.actor = new St.BoxLayout({ name: 'LookingGlassDialog',
vertical: true,
visible: false });
let gconf = Shell.GConf.get_default();
- gconf.watch_directory("/desktop/gnome/interface");
- gconf.connect("changed::/desktop/gnome/interface/monospace_font_name",
+ gconf.watch_directory('/desktop/gnome/interface');
+ gconf.connect('changed::/desktop/gnome/interface/monospace_font_name',
Lang.bind(this, this._updateFont));
this._updateFont();
Main.uiGroup.add_actor(this.actor);
- let toolbar = new St.BoxLayout({ name: "Toolbar" });
+ let toolbar = new St.BoxLayout({ name: 'Toolbar' });
this.actor.add_actor(toolbar);
let inspectIcon = St.TextureCache.get_default().load_gicon(new Gio.ThemedIcon({ name: 'gtk-color-picker' }),
24);
toolbar.add(emptyBox, { expand: true });
toolbar.add_actor(notebook.tabControls);
- this._evalBox = new St.BoxLayout({ name: "EvalBox", vertical: true });
+ this._evalBox = new St.BoxLayout({ name: 'EvalBox', vertical: true });
notebook.appendPage('Evaluator', this._evalBox);
- this._resultsArea = new St.BoxLayout({ name: "ResultsArea", vertical: true });
+ this._resultsArea = new St.BoxLayout({ name: 'ResultsArea', vertical: true });
this._evalBox.add(this._resultsArea, { expand: true });
- let entryArea = new St.BoxLayout({ name: "EntryArea" });
+ let entryArea = new St.BoxLayout({ name: 'EntryArea' });
this._evalBox.add_actor(entryArea);
let label = new St.Label({ text: 'js>>> ' });
// newline-separated.
text.replace('\n', ' ');
// Strip leading and trailing whitespace
- text = text.replace(/^\s+/g, "").replace(/\s+$/g, "");
+ text = text.replace(/^\s+/g, '').replace(/\s+$/g, '');
if (text == '')
return true;
this._evaluate(text);
_updateFont: function() {
let gconf = Shell.GConf.get_default();
- let fontName = gconf.get_string("/desktop/gnome/interface/monospace_font_name");
+ let fontName = gconf.get_string('/desktop/gnome/interface/monospace_font_name');
// This is mishandled by the scanner - should by Pango.FontDescription_from_string(fontName);
// https://bugzilla.gnome.org/show_bug.cgi?id=595889
let fontDesc = Pango.Font.description_from_string(fontName);
try {
resultObj = eval(fullCmd);
} catch (e) {
- resultObj = "<exception " + e + ">";
+ resultObj = '<exception ' + e + '>';
}
this._pushResult(command, resultObj);
global.stage.set_key_focus(this._entry);
Tweener.addTween(this.actor, { time: 0.5,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
y: this._targetY
});
},
Main.popModal(this.actor);
Tweener.addTween(this.actor, { time: 0.5,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
y: this._hiddenY,
onComplete: Lang.bind(this, function () {
this.actor.hide();
const DEFAULT_CROSSHAIRS_CLIP = false;
const DEFAULT_CROSSHAIRS_CLIP_SIZE = [100, 100];
const DEFAULT_CROSSHAIRS_COLOR = new Clutter.Color();
-DEFAULT_CROSSHAIRS_COLOR.from_string("Red");
+DEFAULT_CROSSHAIRS_COLOR.from_string('Red');
// GConf settings
-const A11Y_MAG_PREFS_DIR = "/desktop/gnome/accessibility/magnifier";
-const SHOW_KEY = A11Y_MAG_PREFS_DIR + "/show_magnifier";
-const SCREEN_POSITION_KEY = A11Y_MAG_PREFS_DIR + "/screen_position";
-const MAG_FACTOR_KEY = A11Y_MAG_PREFS_DIR + "/mag_factor";
-const LENS_MODE_KEY = A11Y_MAG_PREFS_DIR + "/lens_mode";
-const CLAMP_MODE_KEY = A11Y_MAG_PREFS_DIR + "/scroll_at_edges";
-const MOUSE_TRACKING_KEY = A11Y_MAG_PREFS_DIR + "/mouse_tracking";
-const SHOW_CROSS_HAIRS_KEY = A11Y_MAG_PREFS_DIR + "/show_cross_hairs";
-const CROSS_HAIRS_THICKNESS_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_thickness";
-const CROSS_HAIRS_COLOR_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_color";
-const CROSS_HAIRS_OPACITY_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_opacity";
-const CROSS_HAIRS_LENGTH_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_length";
-const CROSS_HAIRS_CLIP_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_clip";
+const A11Y_MAG_PREFS_DIR = '/desktop/gnome/accessibility/magnifier';
+const SHOW_KEY = A11Y_MAG_PREFS_DIR + '/show_magnifier';
+const SCREEN_POSITION_KEY = A11Y_MAG_PREFS_DIR + '/screen_position';
+const MAG_FACTOR_KEY = A11Y_MAG_PREFS_DIR + '/mag_factor';
+const LENS_MODE_KEY = A11Y_MAG_PREFS_DIR + '/lens_mode';
+const CLAMP_MODE_KEY = A11Y_MAG_PREFS_DIR + '/scroll_at_edges';
+const MOUSE_TRACKING_KEY = A11Y_MAG_PREFS_DIR + '/mouse_tracking';
+const SHOW_CROSS_HAIRS_KEY = A11Y_MAG_PREFS_DIR + '/show_cross_hairs';
+const CROSS_HAIRS_THICKNESS_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_thickness';
+const CROSS_HAIRS_COLOR_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_color';
+const CROSS_HAIRS_OPACITY_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_opacity';
+const CROSS_HAIRS_LENGTH_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_length';
+const CROSS_HAIRS_CLIP_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_clip';
let magDBusService = null;
/**
* setCrosshairsColor:
* Set the color of the crosshairs for all ZoomRegions.
- * @color: The color as a string, e.g. "#ff0000ff" or "red".
+ * @color: The color as a string, e.g. '#ff0000ff' or 'red'.
*/
setCrosshairsColor: function(color) {
if (this._crossHairs) {
/**
* getCrosshairsColor:
* Get the color of the crosshairs.
- * @return: The color as a string, e.g. "#0000ffff" for blue.
+ * @return: The color as a string, e.g. '#0000ffff' or 'blue'.
*/
getCrosshairsColor: function() {
if (this._crossHairs) {
return clutterColor.to_string();
}
else
- return "#00000000";
+ return '#00000000';
},
/**
};
// For making unique ZoomRegion DBus proxy object paths of the form:
-// "/org/gnome/Magnifier/ZoomRegion/zoomer0",
-// "/org/gnome/Magnifier/ZoomRegion/zoomer1", etc.
+// '/org/gnome/Magnifier/ZoomRegion/zoomer0',
+// '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc.
let _zoomRegionInstanceCount = 0;
function ShellMagnifier() {
let ROI = { x: roi[0], y: roi[1], width: roi[2], height: roi[3] };
let viewBox = { x: viewPort[0], y: viewPort[1], width: viewPort[2], height: viewPort[3] };
let realZoomRegion = Main.magnifier.createZoomRegion(xMagFactor, yMagFactor, ROI, viewBox);
- let objectPath = ZOOM_SERVICE_PATH + "/zoomer" + _zoomRegionInstanceCount;
+ let objectPath = ZOOM_SERVICE_PATH + '/zoomer' + _zoomRegionInstanceCount;
_zoomRegionInstanceCount++;
let zoomRegionProxy = new ShellMagnifierZoomRegion(objectPath, realZoomRegion);
}
if (!found) {
// Got a ZoomRegion with no DBus proxy, make one.
- let newPath = ZOOM_SERVICE_PATH + "/zoomer" + _zoomRegionInstanceCount;
+ let newPath = ZOOM_SERVICE_PATH + '/zoomer' + _zoomRegionInstanceCount;
_zoomRegionInstanceCount++;
let zoomRegionProxy = new ShellMagnifierZoomRegion(newPath, aZoomRegion);
let proxyAndZoomer = {};
let background = null;
function start() {
- // Add a binding for "global" in the global JS namespace; (gjs
+ // Add a binding for 'global' in the global JS namespace; (gjs
// keeps the web browser convention of having that namespace be
- // called "window".)
+ // called 'window'.)
window.global = Shell.Global.get();
// Now monkey patch utility functions into the global proxy;
global.logError = _logError;
global.log = _logDebug;
- Gio.DesktopAppInfo.set_desktop_env("GNOME");
+ Gio.DesktopAppInfo.set_desktop_env('GNOME');
global.grab_dbus_service();
shellDBusService = new ShellDBus.GnomeShell();
global.stage.color = DEFAULT_BACKGROUND_COLOR;
let themeContext = St.ThemeContext.get_for_stage (global.stage);
- let stylesheetPath = global.datadir + "/theme/gnome-shell.css";
+ let stylesheetPath = global.datadir + '/theme/gnome-shell.css';
let theme = new St.Theme ({ application_stylesheet: stylesheetPath });
themeContext.set_theme (theme);
let shellwm = global.window_manager;
- shellwm.takeover_keybinding("panel_main_menu");
- shellwm.connect("keybinding::panel_main_menu", function () {
+ shellwm.takeover_keybinding('panel_main_menu');
+ shellwm.connect('keybinding::panel_main_menu', function () {
overview.toggle();
});
- shellwm.takeover_keybinding("panel_run_dialog");
- shellwm.connect("keybinding::panel_run_dialog", function () {
+ shellwm.takeover_keybinding('panel_run_dialog');
+ shellwm.connect('keybinding::panel_run_dialog', function () {
getRunDialog().open();
});
} else {
//read the parameters from GConf always in case they have changed
let gconf = Shell.GConf.get_default();
- recorder.set_framerate(gconf.get_int("recorder/framerate"));
- recorder.set_filename("shell-%d%u-%c." + gconf.get_string("recorder/file_extension"));
- let pipeline = gconf.get_string("recorder/pipeline");
+ recorder.set_framerate(gconf.get_int('recorder/framerate'));
+ recorder.set_filename('shell-%d%u-%c.' + gconf.get_string('recorder/file_extension'));
+ let pipeline = gconf.get_string('recorder/pipeline');
if (!pipeline.match(/^\s*$/))
recorder.set_pipeline(pipeline);
else
for (let i = 2; i < arguments.length; i++) {
text += JSON.stringify(arguments[i]);
if (i < arguments.length - 1)
- text += " ";
+ text += ' ';
}
}
_errorLogStack.push({timestamp: new Date().getTime(),
if (symbol == Clutter.Print) {
// We want to be able to take screenshots of the shell at all times
let gconf = Shell.GConf.get_default();
- let command = gconf.get_string("/apps/metacity/keybinding_commands/command_screenshot");
- if (command != null && command != "") {
+ let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot');
+ if (command != null && command != '') {
let [ok, len, args] = GLib.shell_parse_argv(command);
let p = new Shell.Process({'args' : args});
p.run();
function pushModal(actor) {
if (modalCount == 0) {
if (!global.begin_modal(global.get_current_time())) {
- log("pushModal: invocation of begin_modal failed");
+ log('pushModal: invocation of begin_modal failed');
return false;
}
}
*/
function initializeDeferredWork(actor, callback, props) {
// Turn into a string so we can use as an object property
- let workId = "" + (++_deferredWorkSequence);
+ let workId = '' + (++_deferredWorkSequence);
_deferredWorkData[workId] = { 'actor': actor,
'callback': callback };
actor.connect('notify::mapped', function () {
function queueDeferredWork(workId) {
let data = _deferredWorkData[workId];
if (!data) {
- global.logError("invalid work id ", workId);
+ global.logError('invalid work id ', workId);
return;
}
if (_deferredWorkQueue.indexOf(workId) < 0)
function _cleanMarkup(text) {
// Support &, ", ', < and >, escape all other
// occurrences of '&'.
- let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, "&");
+ let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, '&');
// Support <b>, <i>, and <u>, escape anything else
// so it displays as raw markup.
- return _text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, "<$1");
+ return _text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, '<$1');
}
// Notification:
Tweener.addTween(this._bannerLabel,
{ opacity: 0,
time: ANIMATION_TIME,
- transition: "easeOutQuad" });
+ transition: 'easeOutQuad' });
return true;
},
Tweener.addTween(this._bannerLabel,
{ opacity: 255,
time: ANIMATION_TIME,
- transition: "easeOutQuad" });
+ transition: 'easeOutQuad' });
return true;
},
// All of the logic for what happens when occurs here; the various
// event handlers merely update variables such as
- // "this._pointerInTray", "this._summaryState", etc, and
+ // 'this._pointerInTray', 'this._summaryState', etc, and
// _updateState() figures out what (if anything) needs to be done
// at the present time.
_updateState: function() {
_showTray: function() {
let primary = global.get_primary_monitor();
- this._tween(this.actor, "_trayState", State.SHOWN,
+ this._tween(this.actor, '_trayState', State.SHOWN,
{ y: primary.y + primary.height - this.actor.height,
time: ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
},
_hideTray: function() {
let primary = global.get_primary_monitor();
- this._tween(this.actor, "_trayState", State.HIDDEN,
+ this._tween(this.actor, '_trayState', State.HIDDEN,
{ y: primary.y + primary.height - 1,
time: ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
},
this._notificationBin.y = this.actor.height;
this._notificationBin.show();
- this._tween(this._notificationBin, "_notificationState", State.SHOWN,
+ this._tween(this._notificationBin, '_notificationState', State.SHOWN,
{ y: 0,
opacity: 255,
time: ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._showNotificationCompleted,
onCompleteScope: this
});
this._reExpandNotificationId = 0;
}
- this._tween(this._notificationBin, "_notificationState", State.HIDDEN,
+ this._tween(this._notificationBin, '_notificationState', State.HIDDEN,
{ y: this.actor.height,
opacity: 0,
time: ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._hideNotificationCompleted,
onCompleteScope: this
});
_expandNotification: function() {
if (this._notification && this._notification.popOut()) {
- this._tween(this._notificationBin, "_notificationState", State.SHOWN,
+ this._tween(this._notificationBin, '_notificationState', State.SHOWN,
{ y: this.actor.height - this._notificationBin.height,
time: ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
if (!this._reExpandNotificationId)
let primary = global.get_primary_monitor();
this._summaryBin.opacity = 0;
this._summaryBin.y = this.actor.height;
- this._tween(this._summaryBin, "_summaryState", State.SHOWN,
+ this._tween(this._summaryBin, '_summaryState', State.SHOWN,
{ y: 0,
opacity: 255,
time: ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._showSummaryCompleted,
onCompleteScope: this,
onCompleteParams: [withTimeout]
},
_hideSummary: function() {
- this._tween(this._summaryBin, "_summaryState", State.HIDDEN,
+ this._tween(this._summaryBin, '_summaryState', State.HIDDEN,
{ opacity: 0,
time: ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
this._summaryNeedsToBeShown = false;
},
this._summaryNotificationBin.y = this.actor.height;
this._summaryNotificationBin.show();
- this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.SHOWN,
+ this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.SHOWN,
{ y: this.actor.height - this._summaryNotificationBin.height,
opacity: 255,
time: ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
if (!this._reExpandSummaryNotificationId)
},
_reExpandSummaryNotification: function() {
- this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.SHOWN,
+ this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.SHOWN,
{ y: this.actor.height - this._summaryNotificationBin.height,
time: ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
},
_hideSummaryNotification: function() {
this._summaryNotification.popIn();
- this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.HIDDEN,
+ this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.HIDDEN,
{ y: this.actor.height,
opacity: 0,
time: ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._hideSummaryNotificationCompleted,
onCompleteScope: this
});
// kill the notification-daemon. pkill is more portable
// than killall, but on Linux at least it won't match if
// you pass more than 15 characters of the process name...
- // However, if you use the "-f" flag to match the entire
+ // However, if you use the '-f' flag to match the entire
// command line, it will work, but we have to be careful
- // in that case that we don't match "gedit
- // notification-daemon.c" or whatever...
+ // in that case that we don't match 'gedit
+ // notification-daemon.c' or whatever...
let p = new Shell.Process({ args: ['pkill', '-f',
'^([^ ]*/)?(notification-daemon|notify-osd)$']});
p.run();
/* center */
- let clockButton = new St.Button({ style_class: "panel-button",
+ let clockButton = new St.Button({ style_class: 'panel-button',
toggle_mode: true,
x_fill: true,
y_fill: true });
Tweener.addTween(this.actor,
{ y: 0,
time: 0.2,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
},
case 'unix':
// force updates every second
showSeconds = true;
- clockFormat = "%s";
+ clockFormat = '%s';
break;
case 'custom':
// force updates every second
Tweener.addTween(this.actor,
{ y: panelActor.y + panelActor.height,
time: 0.2,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
},
Tweener.addTween(this.actor,
{ y: panelActor.y + panelActor.height - this.actor.height,
time: 0.2,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: function() { this.actor.hide(); },
onCompleteScope: this
});
this._mount = mount;
this.name = mount.get_name();
this._lowerName = this.name.toLowerCase();
- this.id = "mount:" + mount.get_root().get_uri();
+ this.id = 'mount:' + mount.get_root().get_uri();
},
iconFactory: function(size) {
this._connect = new PlaceInfo('special:connect', _("Connect to..."),
function (size) {
- return St.TextureCache.get_default().load_icon_name("applications-internet", size);
+ return St.TextureCache.get_default().load_icon_name('applications-internet', size);
},
function () {
new Shell.Process({ args: ['nautilus-connect-server'] }).run();
try {
networkApp = Shell.AppSystem.get_default().load_from_desktop_file('network-scheme.desktop');
} catch(e) {
- log("Cannot create \"Network\" item, .desktop file not found or corrupt.");
+ log('Cannot create "Network" item, .desktop file not found or corrupt.');
}
}
this._volumeMonitor.connect('drive-changed', Lang.bind(this, this._updateDevices));
this._updateDevices();
- this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), ".gtk-bookmarks"]);
+ this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), '.gtk-bookmarks']);
this._bookmarksFile = Gio.file_new_for_path(this._bookmarksPath);
let monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null);
this._bookmarkTimeoutId = 0;
this._isDesktopHome = gconf.get_boolean(DESKTOP_IS_HOME_KEY);
if (this._isDesktopHome)
- this._removeById(this._defaultPlaces, "special:desktop");
+ this._removeById(this._defaultPlaces, 'special:desktop');
else
this._defaultPlaces.splice(this._desktopMenuIndex, 0,
this._desktopMenu);
this._paths[i] = file.get_path();
this._monitors[i] = file.monitor_directory(Gio.FileMonitorFlags.NONE, null);
if (this._monitors[i] != null) {
- this._monitors[i].connect("changed", Lang.bind(this, this._onChanged));
+ this._monitors[i].connect('changed', Lang.bind(this, this._onChanged));
}
}
this._paths = this._paths.filter(function(a) {
},
getCompletion: function(text) {
- let common = "";
+ let common = '';
let notInit = true;
if (!this._valid) {
this._update(0);
break;
}
if (k == 0)
- return "";
+ return '';
return s1.substr(0, k);
}
function _hasPrefix(s1, prefix) {
// We are only interested in the actual error, so parse
//that out.
let m = /.+\((.+)\)/.exec(e);
- let errorStr = _("Execution of '%s' failed:").format(command) + "\n" + m[1];
+ let errorStr = _("Execution of '%s' failed:").format(command) + '\n' + m[1];
this._errorMessage.set_text(errorStr);
this._errorBox.show();
* The terms are useful for search match highlighting.
*/
renderResults: function(results, terms) {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
},
/**
* Returns: The number of actors visible.
*/
getVisibleResultCount: function() {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
},
/**
* available.
*/
selectIndex: function() {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
},
/**
* Activate the currently selected search result.
*/
activateSelected: function() {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
}
};
* or network queries.
*/
getInitialResultSet: function(terms) {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
},
/**
* result set, rather than possibly performing a full re-query.
*/
getSubsearchResultSet: function(previousResults, newTerms) {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
},
/**
* properties which describe the given search result.
*/
getResultMeta: function(id) {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
},
/**
* Called when the user chooses a given result.
*/
activateResult: function(id) {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
},
/**
* displaying search results for that item type.
*/
expandSearch: function(terms) {
- throw new Error("not implemented");
+ throw new Error('Not implemented');
}
};
Signals.addSignalMethods(SearchProvider.prototype);
},
updateSearch: function(searchString) {
- searchString = searchString.replace(/^\s+/g, "").replace(/\s+$/g, "");
+ searchString = searchString.replace(/^\s+/g, '').replace(/\s+$/g, '');
if (searchString == '')
return null;
const Main = imports.ui.main;
const GnomeShellIface = {
- name: "org.gnome.Shell",
- methods: [{ name: "Eval",
- inSignature: "s",
- outSignature: "bs"
+ name: 'org.gnome.Shell',
+ methods: [{ name: 'Eval',
+ inSignature: 's',
+ outSignature: 'bs'
}
],
signals: [],
- properties: [{ name: "OverviewActive",
- signature: "b",
- access: "readwrite" }]
+ properties: [{ name: 'OverviewActive',
+ signature: 'b',
+ access: 'readwrite' }]
};
function GnomeShell() {
returnValue = JSON.stringify(eval(code));
// A hack; DBus doesn't have null/undefined
if (returnValue == undefined)
- returnValue = "";
+ returnValue = '';
success = true;
} catch (e) {
returnValue = JSON.stringify(e);
const SCROLLBACK_RECENT_LENGTH = 20;
const SCROLLBACK_IDLE_LENGTH = 5;
-// This is GNOME Shell's implementation of the Telepathy "Client"
-// interface. Specifically, the shell is a Telepathy "Observer", which
+// This is GNOME Shell's implementation of the Telepathy 'Client'
+// interface. Specifically, the shell is a Telepathy 'Observer', which
// lets us see messages even if they belong to another app (eg,
// Empathy).
// Called from Main.start
function init() {
- let slowdownEnv = GLib.getenv("GNOME_SHELL_SLOWDOWN_FACTOR");
+ let slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR');
if (slowdownEnv) {
let factor = parseFloat(slowdownEnv);
if (!isNaN(factor) && factor > 0.0)
}
-// The "FrameTicker" object is an object used to feed new frames to
+// The 'FrameTicker' object is an object used to feed new frames to
// Tweener so it can update values and redraw. The default frame
// ticker for Tweener just uses a simple timeout at a fixed frame rate
// and has no idea of "catching up" by dropping frames.
x: xDest,
y: 0,
time: WINDOW_ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._minimizeWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
Tweener.addTween(actor,
{ opacity: 255,
time: WINDOW_ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._mapWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
{ x: xDest,
y: yDest,
time: WINDOW_ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: this._switchWorkspaceDone,
onCompleteScope: this,
onCompleteParams: [shellwm]
{ x: 0,
y: 0,
time: WINDOW_ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
},
_showWorkspaceSwitcher : function(shellwm, binding, window, backwards) {
/* We don't support this kind of layout */
- if (binding == "switch_to_workspace_up" || binding == "switch_to_workspace_down")
+ if (binding == 'switch_to_workspace_up' || binding == 'switch_to_workspace_down')
return;
if (global.screen.n_workspaces == 1)
if (this._workspaceSwitcherPopup == null)
this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup();
- if (binding == "switch_to_workspace_left") {
+ if (binding == 'switch_to_workspace_left') {
this.actionMoveWorkspaceLeft();
}
- if (binding == "switch_to_workspace_right") {
+ if (binding == 'switch_to_workspace_right') {
this.actionMoveWorkspaceRight();
}
},
Tweener.addTween(this._desktop,
{ opacity: 255,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad" });
+ transition: 'easeOutQuad' });
}
},
Tweener.addTween(this._desktop,
{ opacity: 0,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: Lang.bind(this,
function() {
this._desktop.hide();
this._windowClone = windowClone;
this._parentActor = parentActor;
- let title = new St.Label({ style_class: "window-caption",
+ let title = new St.Label({ style_class: 'window-caption',
text: metaWindow.title });
title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
title._spacing = 0;
this.title.text = w.title;
}));
- let button = new St.Button({ style_class: "window-close" });
+ let button = new St.Button({ style_class: 'window-close' });
button._overlap = 0;
this._idleToggleCloseId = 0;
Tweener.addTween(this.title,
{ opacity: 255,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad" });
+ transition: 'easeOutQuad' });
},
chromeWidth: function () {
Tweener.addTween(clone.actor,
{ opacity: 255,
time: Overview.ANIMATION_TIME,
- transition: "easeInQuad"
+ transition: 'easeInQuad'
});
}
scale_y: scale,
workspace_relative: workspaceZooming ? this : null,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() {
this._fadeInWindowOverlay(clone, overlay);
})
workspace_relative: this,
time: Overview.ANIMATION_TIME,
opacity: 255,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
} else {
// The window is hidden, make it shrink and fade it out
opacity: 0,
workspace_relative: this,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
}
}
scale_x: this.scale,
scale_y: this.scale,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: Lang.bind(this, this._fadeInAllOverlays)
});
},
scale_x: this.scale,
scale_y: this.scale,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
this._visible = true;
scale_x: this.scale,
scale_y: this.scale,
time: Overview.ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: onComplete
});
this._scaleWidth = global.screen_width / global.screen_height;
- this._container = new St.BoxLayout({ style_class: "workspace-switcher-container" });
- this._list = new St.BoxLayout({ style_class: "workspace-switcher" });
+ this._container = new St.BoxLayout({ style_class: 'workspace-switcher-container' });
+ this._list = new St.BoxLayout({ style_class: 'workspace-switcher' });
this._container.add(this._list);
_show : function() {
Tweener.addTween(this._container, { opacity: 255,
time: ANIMATION_TIME,
- transition: "easeOutQuad"
+ transition: 'easeOutQuad'
});
this._position();
this.actor.show();
this._timeoutId = 0;
Tweener.addTween(this._container, { opacity: 0.0,
time: ANIMATION_TIME,
- transition: "easeOutQuad",
+ transition: 'easeOutQuad',
onComplete: function() { this.actor.hide(); },
onCompleteScope: this
});
GenericWorkspacesView.prototype = {
_init: function(width, height, x, y, workspaces) {
- this.actor = new St.Bin({ style_class: "workspaces" });
+ this.actor = new St.Bin({ style_class: 'workspaces' });
this._actor = new Clutter.Group();
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
},
createControllerBar: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
canAddWorkspace: function() {
},
_getWorkspaceIndexToRemove: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
canRemoveWorkspace: function() {
},
updateWorkspaces: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
_transitionWorkspaces: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
_computeWorkspacePositions: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
_activeWorkspaceChanged: function() {
- throw new Error("Not implemented");
+ throw new Error('Not implemented');
},
_acceptNewWorkspaceDrop: function(source, dropActor, x, y, time) {